﻿using System;
using System.Collections.Generic;

namespace DigitalQuran.Qnl
{
    public class QnlException : Exception
    {
        public QnlException(string message, int index, int length) : base(message)
        {
            Index = index;
            Length = length;
        }

        internal QnlException(string message, Token t)
            : this(message, t.Index, t.Length) { }

        internal QnlException(Token t, int maxValue)
            : this("Value must be non-zero positive integer upto " + maxValue, t.Index, t.Length) { }

        public int Index { get; private set; }
        public int Length { get; private set; }
    }
}